-
-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make neoforge.mods.toml a generated resource, making it compatible with running from IDE #97
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a big fan of this change. I just converted MI to this pattern so I can finally build it Gradle-free in my IDE. 😄
build.gradle
Outdated
into("build/generated/sources/modMetadata") | ||
} | ||
sourceSets.main.resources.srcDir(generateModMetadata) | ||
tasks.named("neoForgeIdeSync").configure { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to have a nice constant for this? For example, neoForge.ideSyncTask
? Not sure we want to make the exact task name API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this line in particular I was not so keen on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose that directly writing the task name in the script and exposing a constant for the task name in the API would be more idiomatic than my suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, we actually do make an api on the extension...
neoForge.runTaskOnIdeSync
It's a bit niche though
ed2cd12
to
370fb31
Compare
…th running from IDE
7473eaf
to
0ef7d20
Compare
Switching to this approach adds full support for placeholders in neoforge.mods.toml
In contrast to other approaches, this exposes the file where the placeholders are already replaced to the IDE as a normal source-file, meaning it is still responsible for copying it, but that also means cleaning & rebuilding from IDE has the normal intended effect, rather than it conflicting with other Gradle tasks writing to its output directory.